import { http } from "@/utils/request";
import type { CategoryResponse, CategoryLinkResponse } from "./type";
// 获取分类列表
export const getCategoryListApi = (page?: number, pageSize?: number) => {
  return http.get<CategoryResponse>("/category", {
    params: {
      page: page,
      pageSize: pageSize,
    },
  });
};

// 获取分类
export const getCategoryAPI = (id: number) => {
  return http.get<CategoryLinkResponse>(`/category/${id}/link`, {});
};

// 查询分类
export const searchCategoryAPI = (title: string) => {
  return http.get(`/category/${title}/search`, {});
};
